package com.heima.mapper;

import com.github.pagehelper.Page;
import com.heima.pojo.Node;
import com.heima.pojo.Region;
import com.heima.pojo.dto.AddRegionDTO;
import com.heima.pojo.dto.RegionPageDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RegionMapper {

    Page<Region> pageQuery(RegionPageDTO dto);
    @Select("select count(*) from tb_node where region_id = #{regionId}")
    List<Node> getNodeId(Long id);

    void add(Region region);

    @Delete("delete from tb_region where id=#{id}")
    Integer deleteId(Long id);



    void upd(Region region);
@Select("select * from tb_region where id = #{id}")
    Long getregionId(Long id);

@Select("select * from tb_region where id = #{id}")
    Region selevtById(Long id);
}
